from tools_algorithm import *


class Solution:
    def minOperations(self, nums: List[int], k: int) -> int:
        heapify(nums)
        ans = 0
        while nums[0] < k:
            a = heappop(nums)
            b = heappop(nums)
            heappush(nums, min(a, b) * 2 + max(a, b))
            ans += 1
        return ans


s = Solution()
print(s.minOperations([2, 11, 10, 1, 3], 10))
